package com.yeskery.boot.log.record.starter.annotation;

import com.yeskery.boot.log.record.starter.config.LogRecordConfigureSelector;
import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.Import;

import java.lang.annotation.*;

/**
 * 日志记录启动注解
 * @author dushuangjiang
 * @date 2021-11-16 18:09
 */
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Import(LogRecordConfigureSelector.class)
public @interface EnableLogRecord {

    /**
     * 多租户隔离，防止其它租户的日志记录被当前租户访问到
     * @return 当前租户的需要记录日志的包路径
     */
    String tenant();

    /**
     * Spring 织入方式，默认为 {@link AdviceMode#PROXY}
     * @return Spring 织入方式
     */
    AdviceMode mode() default AdviceMode.PROXY;
}
